# -*- coding: utf-8 -*-
import sys
from com.android.monkeyrunner import MonkeyRunner
from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder

device = MonkeyRunner.waitForConnection()
device.removePackage('com.ymatou.shop')
device.installPackage('D:/ymatou3.5.0-buyer-official-20170427.apk')

if not device:
    print >> sys.stderr,"fail"
    sys.exit(1)
else:
    print >> sys.stderr,"sucess"

MonkeyRunner.sleep(3)

device.startActivity(component='com.ymatou.shop/com.ymatou.shop.ui.activity.SplashActivity')


recorder.start(device)